package com.xuecheng.test.rabbitmq.mq;

import com.alibaba.fastjson.JSON;
import com.rabbitmq.client.Channel;
import com.xuecheng.test.rabbitmq.config.RabbitmqConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class ReceiveHeaadler {
    @RabbitListener(queues ={RabbitmqConfig.QUEUE_INFORM_EMAIL})
    public void send_email(String msg, Message message,Channel channel){
        //System.out.println(msg);
        Map map= JSON.parseObject(msg,Map.class);
        String s=map.get("getId").toString();
        System.out.println(s);
    }
}
